<?php
	header("Content-Type: text/html;charset=utf-8");
	include("function/_nosql.php"); //
	include("function/function.php");
	$kboy_userid = $_SESSION['kboy_userid'];
	$kboy_user = $_SESSION['kboy_user'];
	
	$uid = chkstr(trim($_REQUEST['uid']));
	$ac = chkstr(trim($_REQUEST['ac']));
	$newsid = chkstr(trim($_REQUEST['newsid']));
	if(empty($uid)){
		echo erro("参数错误");
	}
	if(!is_numeric($uid)){
		echo erro("参数错误");
	}
	if(getNewsNums("kboy_user","uid=$uid") <1){
		echo erro("参数错误");
	}
	if(is_numeric($newsid)){
		$sql="select * from kboy_forum_active where id=$newsid and uid=$uid";
		$rows=mysql_query($sql);
		$nums=mysql_num_rows($rows);
		if($nums>0){
			$rs=mysql_fetch_array($rows);
				$active_title = $rs['active_title'];          //
				$active_bigclass = $rs['active_bigclass'];
				$active_renzheng = $rs['active_renzheng'];
				$active_mingyi = $rs['active_mingyi'];
				$active_fanwei = $rs['active_fanwei'];
				$active_xianzhi = $rs['active_xianzhi'];
				$active_all_money = $rs['active_all_money'];//
				$active_part_money = $rs['active_part_money'];//
				$active_end_user = $rs['active_end_user'];
				$active_text = $rs['active_text'];//
				
				$active_pic = explode(',',$rs['active_pic']) ;		//
				$active_sollimg = explode(',',$rs['active_sollimg']) ;
				$active_zhong = explode(',',$rs['active_zhong']) ;
				
				$active_hd_content = $rs['active_hd_content'];
				$active_all_line = $rs['active_all_line'];
				$active_start_prov = $rs['active_start_prov'];
				$active_start_city = $rs['active_start_city'];
				$active_end_prov = $rs['active_end_prov'];
				$active_end_city = $rs['active_end_city'];
				$active_start_time = $rs['active_start_time'];
				$active_end_time = $rs['active_end_time'];
				$active_power = $rs['active_power'];
				$active_post_time = $rs['active_post_time'];
				$active_center = $rs['active_center'];
				$active_center_time = $rs['active_center_time'];
				$active_jingdian = $rs['active_jingdian'];
				$active_traffic = $rs['active_traffic'];
				$active_traffic_info = $rs['active_traffic_info'];
				$active_contact = $rs['active_contact'];
				$active_contact_people = $rs['active_contact_people'];
				$active_contact_phone = $rs['active_contact_phone'];
				$active_people = $rs['active_people'];
				$active_line = stripslashes($rs['active_line']);
				$active_xingcheng = stripslashes($rs['active_xingcheng']);
				$active_zhuangbei = stripslashes($rs['active_zhuangbei']);
				$active_baoming = stripslashes($rs['active_baoming']);
				$active_ditu = stripslashes($rs['active_ditu']);
				$active_koubei = stripslashes($rs['active_koubei']);
				$active_addtime = $rs['active_addtime'];
				$active_id = $rs['id'];
				$active_transport=$rs['active_transport'];
				$active_charge_details=$rs['active_charge_details'];
				$active_cva_money=$rs['active_cva_money'];
				$active_object=$rs['active_object'];
				
				$active_zhubanfang=$rs['active_zhubanfang'];
				$active_xiebanfang=$rs['active_xiebanfang'];
				$active_hezuopinpai=$rs['active_hezuopinpai'];
				$active_hezuomeiti=$rs['active_hezuomeiti'];
				$active_banner = $rs['active_banner'];
				
				
				$news_content = stripslashes($rs['travel_content']);
				$news_hit = $rs['travel_hit'];
				
		}else{
			echo erro("该信息已被删除或不存在");
		}
	}else{
		echo erro("该信息已被删除或不存在");
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我的活动_社区_<?= $web_titles ?></title>
<meta name="Keywords" content="我的活动,社区,<?= $web_keywords ?>" />
<meta name="Description" content="<?= $web_description ?>" />
<link rel="stylesheet" href="css/common.css"/>
<link rel="stylesheet" href="css/sq.css"/>
<link href="themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/baidutongji.js"></script>
<script type="text/javascript" src="js/laydate/laydate.js"></script>
</head>
<body>
    <!--top-bar begin-->
	<? include("_include.top.topbar.php") ?>
    <!--top-bar end-->
    <!--header begin-->
	<? include("_include.top.navbar.php") ?>
    <!--header end-->
    <!--banner begin-->
	<? include("_include.forum.banners.php") ?>
    <!--banner end-->
    <!--活动 begin-->
<!--活动 begin-->
<div class="sq-wrap">
		<? include("_include.forum.title.php") ?>
        <div class="sq-bd">
			<? include("_include.forum.topnav.php") ?>
        <div class="sq-bd-con">
            <div class="editor_box">
                <div class="editor_hd">
                    <div class="sign">发布活动</div>
                    <div class="e-option"></div>
                </div>
				<form name="myform" id="myform" method="post" action="forum_activeaddsave.php?action=editsave">
				<input type="hidden" name="newsid" value="<?=$newsid;?>" />
                <div class="editor-wrap">
                    <div class="editor-table">
                        <ul class="editor_in">
                            <li>
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>活动性质：</span>
                                    <select class="basic-select" name="active_bigclass" id="active_bigclass">
									<option value="">==请选择板块==</option>
									<?php
										$bigIDs = 134;
										getSoonClass_option($bigIDs,'',$active_bigclass,3); // 下拉option
									?>
                                    </select>
                                    <span class="rz">CVA认证 : <input type="checkbox" <?php if($active_renzheng == 1){ ?> checked="checked" <?php } ?> name="renzheng" class="renzheng" value="1" /></span>
                                </dd>
                            </li>
                            <li>
                                <dd>
                                    <span class="e-l"><em>*</em>领队：</span>
                                    <input type="text" class="editor-input w100" value="<?=$active_end_user;?>" name="active_end_user" id="active_end_user">
                                </dd>
                            </li>
                            <li>
                                <dd>
                                    <span class="e-l"><em>*</em>活动标题：</span>
                                    <input type="text" class="editor-input w790" value="<?=$active_title;?>" name="active_title" id="active_title">
                                </dd>
                            </li>
							<li>
                                <dd>
                                    <span class="e-l"><em>*</em>活动主题：</span>
                                    <input type="text" class="editor-input w790" name="active_object"  value="<?=$active_object;?>" id="active_object">
                                </dd>
                            </li>
                            <li>
                                <dd>
                                    <span class="e-l">活动特色：</span>
                                    <textarea class="basic-area" name="active_text" id="active_text"><?=$active_text;?></textarea>
                                </dd>
                            </li>
							
                            <li>
                                <dd>
                                    <span class="e-l"><em></em>顶部BANNER：</span>
                                    <input type="text" class="editor-input w790" style="width:310px;" name="active_banner" id="active_banner" value="<?=$active_banner?>">
                                    <input type="button" name="Submit2" value="上传图片" class="upload-img2" />仅用于大型活动
                                </dd>
                            </li>


                            <li>
                                <dd>
                                    <span class="e-l"><em>*</em>上传图片：</span>
                                    <input type="button" name="Submit" value="上传更多照片" id="upload-images" class="upload-img"/>&nbsp;&nbsp;活动头像的轮播（最多五张）
                                </dd>
                            </li>
                            <?php foreach ($active_pic as $k => $v) { ?>
                       			 <?php if(!empty($v)){ ?>
                            <div id='photo-one' style="width: 100%;">
                            	<li>
                            			
                            		<input type="text" class="editor-input w790" style="width:310px;margin-left:135px;" name="active_pic[]" value="<?=$v ?>" id="active_pic"><a class="shanchu" style="color: red;margin-left: 5px;" href="javascript:;">X</a>
                            		<input type="hidden" name="active_sollimg[]" class="active_sollimg" value="<?=$active_sollimg[$k] ?>" />
                            		<input type="hidden" name="active_zhong[]" class="active_sollimg" value="<?=$active_zhong[$k] ?>" />
                            	</li>
                            </div>
                           		 <?php }else{ ?>
                           		 	<div id='photo-one' style="width: 100%;"></div>
                           		 <?php } ?>	
                        	<?php } ?>
                        		
                        		
                        		
                            <li class="set-line">
                                <dd>
                                    <span class="e-l"><em>*</em>活动内容：</span>
                                    <div class="basic-hide">
                                        <input type="text"/>
                                        <input type="hidden" value="<?=$active_hd_content;?>" name="active_hd_content" id="active_hd_content" />
                                    </div>
                                    <div class="hd-mark">
                                        <ul>
										  <?php
										$bigclass_sql = "select * from kboy_bigclass where pid=144 order by bigclass_order asc, id asc";
										$bigclass_rows = mysql_query($bigclass_sql);
										while($bigclass_rs = mysql_fetch_array($bigclass_rows)){
										?>
                                          <li <?php if(isInclude($active_hd_content,$bigclass_rs['bigclass_cn'])){ echo " class='selected'";} ?>><a href="javascript:;"><?=$bigclass_rs['bigclass_cn']?></a></li>
									   <?php
										}
						               ?>
                                        </ul>
                                    </div>
                                </dd>
                            </li>
                            <li>
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>活动强度级别：</span>
									<select class="editor-input w100" name="active_power" id="active_power">
									<option value="">=级别=</option>
									<?php
										getSoonClass_option(149,'',$active_power,3); // 下拉option
									?>
									</select>
                                </dd>
                                <dd>
                                    <span class="e-l"><em>*</em>活动全程：</span>
                                    <input type="text" class="editor-input w170" value="<?=$active_all_line;?>" name="active_all_line" id="active_all_line"><span>公里</span>
                                </dd>
                            </li>
                            <li>
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>出发地：</span>
                                    <div class="departure_select">
                                        <select class="basic-select prov"  name="active_start_prov"></select>
                                        <select class="basic-select city" disabled="disabled" name="active_start_city"></select>
                                    </div>
                                </dd>
                                <dd>
                                    <span class="e-l"><em>*</em>活动开始时间：</span>
                                    <div class="layinput">
                                        <input type="text" class="editor-input w170" value="<?=$active_start_time;?>" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm'})" name="active_start_time">
                                        <label class="laydate-icon"></label>
                                    </div>
                                </dd>
                            </li>
                            <li>
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>目的地：</span>
                                    <div class="destination_select">
                                        <select class="basic-select prov" name="active_end_prov"></select>
                                        <select class="basic-select city" disabled="disabled" name="active_end_city"></select>
                                    </div>
                                </dd>
                                <dd>
                                    <span class="e-l"><em>*</em>活动结束时间：</span>
                                    <div class="layinput">
                                        <input type="text" class="editor-input w170" value="<?=$active_end_time;?>" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm'})" name="active_end_time" id="active_end_time">
                                        <label class="laydate-icon"></label>
                                    </div>
                                </dd>
                                
                            </li>
                            <li>
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>活动景点：</span>
                                    <input type="text" class="editor-input w170" value="<?=$active_jingdian;?>" name="active_jingdian" id="active_jingdian">
                                </dd>
                                <dd>
                                    <span class="e-l"><em>*</em>报名截止时间：</span>
                                    <div class="layinput">
                                        <input type="text" class="editor-input w170" value="<?=$active_post_time;?>" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm'})" name="active_post_time" id="active_post_time">
                                        <label class="laydate-icon"></label>
                                    </div>
                                </dd>
                            </li>
                            <li>
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>集合时间：</span>
                                    <div class="layinput">
                                        <input type="text" class="editor-input w170" value="<?=$active_center_time;?>" name="active_center_time" id="active_center_time" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm'})">
                                        <label class="laydate-icon"></label>
                                    </div>
                                </dd>
                                <dd>
                                    <span class="e-l"><em>*</em>活动参加人数：</span>
                                    <input type="text" class="editor-input w170" value="<?=$active_xianzhi;?>" name="active_xianzhi" id="active_all_line"><span>人</span>
                                </dd>
                            </li>
                            <li>
                                <dd class="w500" style="width: 100%;">
                                    <span class="e-l"><em>*</em>集合地点：</span>
                                    <input type="text" class="editor-input w170" name="active_center" id="active_center" value="<?=$active_center?>">
                                    <span class="e-l" style="color: red;width: 300px;"><em>*</em>（如有多个地址，请用“逗号”隔开）</span>
                                </dd>
                            </li>
                            <!-- <li class="set-line">
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>出行方式：</span>
                                    <div class="f-way">
                                        <label>
                                            <input type="radio" class="radio" name="active_traffic" value="包车">
                                            <i>包车</i></label>
                                        <label>
                                            <input type="radio" class="radio" name="active_traffic" value="不包车" checked="checked">
                                            <i>不包车[前端此处需调整]</i></label>
                                    </div>
                                </dd>
                                <dd class="w500">
                                    <span class="e-l">车辆信息：</span>
                                    <input type="text" class="editor-input w170" name="active_traffic_info" id="active_traffic_info">
                                </dd>
                            </li> -->
                            <li class="set-line">
                                <dd>
                                    <span class="e-l"><em>*</em>出行方式：</span>
                                    <div class="f-way">
                                        <span id="id_chartered_0">
                                            <label>
                                                <input type="radio" class="radio"  <?php if($active_traffic=='包车'){ echo "checked";} ?>  name="active_traffic" value="包车" >
                                                <i>包车</i>
                                            </label>
                                        </span>
                                        <span id="id_chartered_1">
                                            <label>
                                                <input type="radio" class="radio" <?php if($active_traffic=='不包车'){ echo "checked";} ?> name="active_traffic" value="不包车">
                                                <i>不包车</i>
                                            </label>
                                        </span>
                                    </div>
                                    <div id="businfo">
                                        <span class="e-l"><em>*</em>车辆信息：</span>
                                        <input type="text" class="editor-input w170" value="<?=$active_traffic_info;?>" name="active_traffic_info" id="active_traffic_info">
                                    </div>
                                    <div id="othervehicle">
                                        <ul>
										<?php
										$bigclass_sql = "select * from kboy_bigclass where pid=153 order by bigclass_order asc, id asc";
										$bigclass_rows = mysql_query($bigclass_sql);
										while($bigclass_rs = mysql_fetch_array($bigclass_rows)){
										?>
										   <li><label><input name="active_transport[]" type="checkbox" <?php if(isInclude($active_transport,$bigclass_rs['bigclass_cn'])){ echo " checked";} ?>  value="<?=$bigclass_rs['bigclass_cn']?>"> <?=$bigclass_rs['bigclass_cn']?></label></li>
									   <?php
										}
						               ?>
                                        </ul>
                                    </div>
                                </dd>
                            </li>
                            <li>
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>联系电话：</span>
                                    <input type="text" class="editor-input w170" value="<?=$active_contact;?>" name="active_contact" id="active_contact">
                                </dd>
                                <dd>
                                    <span class="e-l"><em>*</em>应急联系电话：</span>
                                    <input type="text" class="editor-input w170" value="<?=$active_contact_phone;?>" name="active_contact_phone" id="active_contact_phone">
                                </dd>
                            </li>
                            <li>
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>所需人数：</span>
                                    <input type="text" class="editor-input w170" value="<?=$active_people;?>"  name="active_people" id="active_people">
                                </dd>
                                <dd>
                                    <span class="e-l"><em>*</em>会员价：</span>
                                    <input type="text" class="editor-input w170" name="active_cva_money" value="<?=$active_cva_money;?>" id="active_cva_money">
                                </dd>
                            </li>
                            <li>
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>总金额：</span>
                                    <input type="text" class="editor-input w170" value="<?=$active_all_money;?>" name="active_all_money" id="active_all_money">
                                </dd>
                                <dd>
                                    <span class="e-l"><em>*</em>预付金额：</span>
                                    <input type="text" class="editor-input w170" value="<?=$active_part_money;?>" name="active_part_money" id="active_part_money">
                                </dd>
                            </li>
                        </ul>
                        <!--编辑框-->
                        <div class="editor-textBox">
                            <div class="editor-tab">
                                <a href="javascript:;" class="on"><i>*</i>线路描述</a>
								 <a href="javascript:;"><i>*</i>费用说明</a>
                                <a href="javascript:;"><i>*</i>行程安排</a>
                                <a href="javascript:;"><i>*</i>装备要求</a>
                                <a href="javascript:;"><i>*</i>报名须知</a>
								<!--<a href="javascript:;"><i>*</i>目的地地图</a>-->
								<a href="javascript:;"><i>*</i>发起人口碑</a>
								
								<a href="javascript:;"><i></i>主办[大型活动]</a>
								<a href="javascript:;"><i></i>承办[大型活动]</a>
								<a href="javascript:;"><i></i>品牌[大型活动]</a>
								<a href="javascript:;"><i></i>媒体[大型活动]</a>
								
								
								
                            </div>
                            <div class="editor-textBox-bd">
                                <div id="myEditor_line" style="width:1070px;height:600px;"><textarea name="active_line" style="width:1070px;height:600px;visibility:hidden;"><?=$active_line;?></textarea></div>
								<div id="myEditor_charge" style="width:1070px;height:300px;"><textarea name="active_charge_details" style="width:1070px;height:300px;visibility:hidden;"><?=$active_charge_details;?></textarea></div>
                                <div id="myEditor_trip" style="width:1070px;height:300px;"><textarea name="active_xingcheng" style="width:1070px;height:300px;visibility:hidden;"><?=$active_xingcheng;?></textarea></div>
                                <div id="myEditor_equip" style="width:1070px;height:300px;"><textarea name="active_zhuangbei" style="width:1070px;height:300px;visibility:hidden;"><?=$active_zhuangbei;?></textarea></div>
                                <div id="myEditor_sign" style="width:1070px;height:300px;"><textarea name="active_baoming" style="width:1070px;height:300px;visibility:hidden;"><?=$active_baoming;?></textarea></div>
								<!--<div id="myEditor_ditu" style="width:1070px;height:300px;"><textarea name="active_ditu" style="width:1070px;height:300px;visibility:hidden;"><?=$active_ditu;?></textarea></div>-->
                                <div id="myEditor_koubei" style="width:1070px;height:300px;"><textarea name="active_koubei" style="width:1070px;height:300px;visibility:hidden;"><?=$active_koubei;?></textarea></div>
								
								
                                <div id="myEditor_zhuban" style="width:1070px;height:300px;"><textarea name="active_zhubanfang" style="width:1070px;height:300px;visibility:hidden;"><?=$active_zhubanfang;?></textarea></div>
                                <div id="myEditor_chengban" style="width:1070px;height:300px;"><textarea name="active_xiebanfang" style="width:1070px;height:300px;visibility:hidden;"><?=$active_xiebanfang;?></textarea></div>
                                <div id="myEditor_pinpai" style="width:1070px;height:300px;"><textarea name="active_hezuopinpai" style="width:1070px;height:300px;visibility:hidden;"><?=$active_hezuopinpai;?></textarea></div>
                                <div id="myEditor_meiti" style="width:1070px;height:300px;"><textarea name="active_hezuomeiti" style="width:1070px;height:300px;visibility:hidden;"><?=$active_hezuomeiti;?></textarea></div>
								

                            </div>
                        </div>
                        <!--操作-->
                        <div class="editor-op-bd">
							<div style="display:none">
                            <a href="#" class="save-draft">保存草稿</a>
                            <a href="#" class="save-model">保存模板</a>
							</div>
							<input type="submit" class="post-hd" value="发布活动" />
                        </div>
                  </div>
                </div>
				</form>
            </div>
        </div>
    </div>
</div>
    <!--foot begin-->
	<? include("_include.bottom.footbar.php") ?>
    <!--foot begin-->
    <!--左侧悬浮 begin-->
	<? include("_include.bottom.leftbar.php") ?>
    <!--左侧悬浮 end-->
    <!--右侧悬浮导航 begin-->
	<? include("_include.bottom.rightbar.php") ?>
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="js/jquery.SuperSlide.2.1.1.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<script type="text/javascript" src="js/sq.js"></script>
<script type="text/javascript" src="js/jquery.cityselect.js"></script>
<script type="text/javascript"> 
    $(function(){
        $(".departure_select").citySelect({prov:"<?=$active_start_prov;?>", city:"<?=$active_start_city;?>"});
        $(".destination_select").citySelect({prov:"<?=$active_end_prov;?>", city:"<?=$active_end_city;?>"});
    });
</script>


<link rel="stylesheet" href="SunbeamEditor/themes/default/default.css" />
<script charset="utf-8" src="SunbeamEditor/kindeditor-all-min.js"></script>
<script charset="utf-8" src="SunbeamEditor/lang/zh_CN.js"></script>
<script language="javascript">
	$("#myform").submit(function(){
		var active_bigclass = $("#active_bigclass").val();
		var active_end_user = $("#active_end_user").val();
		var active_title = $("#active_title").val();
		var active_pic = $("#active_pic").val();
		var active_power = $("#active_power").val();
		var active_line = $("#active_line").val();
		var active_start_time = $("#active_start_time").val();
		var active_end_time = $("#active_end_time").val();
		var active_center = $("#active_center").val();
		var active_post_time = $("#active_post_time").val();
		var active_jingdian = $("#active_jingdian").val();
		var active_contact = $("#active_contact").val();
		var active_contact_phone = $("#active_contact_phone").val();
		var active_people = $("#active_people").val();
		var active_all_money = $("#active_all_money").val();
		var active_part_money = $("#active_part_money").val();

		if (active_bigclass.replace(/\ /g,"").length<1){
			alert("请选择活动性质！");
			$("#active_bigclass").focus();
			return false;
		}
		if (travel_title.replace(/\ /g,"").length<1){
			alert("游记标题不能为空！");
			$("#travel_title").focus();
			return false;
		}
		if (active_pic.replace(/\ /g,"").length<1){
			alert("图片不能为空！");
			$("#travel_title").focus();
			return false;
		}
		
		
	});


	KindEditor.ready(function(K) {
		var editor = K.create('textarea[name="active_line"]', {
			cssPath : 'SunbeamEditor/plugins/code/prettify.css',
			uploadJson : 'SunbeamEditor/php/upload_json.php',
			fileManagerJson : 'SunbeamEditor/php/file_manager_json.php',
			allowFileManager : false,
			afterBlur: function(){this.sync();}
		});
		var editor = K.create('textarea[name="active_charge_details"]', {
			cssPath : 'SunbeamEditor/plugins/code/prettify.css',
			uploadJson : 'SunbeamEditor/php/upload_json.php',
			fileManagerJson : 'SunbeamEditor/php/file_manager_json.php',
			allowFileManager : false,
			afterBlur: function(){this.sync();}
		});
		var editor = K.create('textarea[name="active_xingcheng"]', {
			cssPath : 'SunbeamEditor/plugins/code/prettify.css',
			uploadJson : 'SunbeamEditor/php/upload_json.php',
			fileManagerJson : 'SunbeamEditor/php/file_manager_json.php',
			allowFileManager : false,
			afterBlur: function(){this.sync();}
		});
		var editor = K.create('textarea[name="active_zhuangbei"]', {
			cssPath : 'SunbeamEditor/plugins/code/prettify.css',
			uploadJson : 'SunbeamEditor/php/upload_json.php',
			fileManagerJson : 'SunbeamEditor/php/file_manager_json.php',
			allowFileManager : false,
			afterBlur: function(){this.sync();}
		});
		var editor = K.create('textarea[name="active_baoming"]', {
			cssPath : 'SunbeamEditor/plugins/code/prettify.css',
			uploadJson : 'SunbeamEditor/php/upload_json.php',
			fileManagerJson : 'SunbeamEditor/php/file_manager_json.php',
			allowFileManager : false,
			afterBlur: function(){this.sync();}
		});
		var editor = K.create('textarea[name="active_ditu"]', {
			cssPath : 'SunbeamEditor/plugins/code/prettify.css',
			uploadJson : 'SunbeamEditor/php/upload_json.php',
			fileManagerJson : 'SunbeamEditor/php/file_manager_json.php',
			allowFileManager : false,
			afterBlur: function(){this.sync();}
		});
		var editor = K.create('textarea[name="active_koubei"]', {
			cssPath : 'SunbeamEditor/plugins/code/prettify.css',
			uploadJson : 'SunbeamEditor/php/upload_json.php',
			fileManagerJson : 'SunbeamEditor/php/file_manager_json.php',
			allowFileManager : false,
			afterBlur: function(){this.sync();}
		});


		var editor = K.create('textarea[name="active_zhubanfang"]', {
			cssPath : 'SunbeamEditor/plugins/code/prettify.css',
			uploadJson : 'SunbeamEditor/php/upload_json.php',
			fileManagerJson : 'SunbeamEditor/php/file_manager_json.php',
			allowFileManager : false,
			afterBlur: function(){this.sync();}
		});
		var editor = K.create('textarea[name="active_xiebanfang"]', {
			cssPath : 'SunbeamEditor/plugins/code/prettify.css',
			uploadJson : 'SunbeamEditor/php/upload_json.php',
			fileManagerJson : 'SunbeamEditor/php/file_manager_json.php',
			allowFileManager : false,
			afterBlur: function(){this.sync();}
		});
		var editor = K.create('textarea[name="active_hezuopinpai"]', {
			cssPath : 'SunbeamEditor/plugins/code/prettify.css',
			uploadJson : 'SunbeamEditor/php/upload_json.php',
			fileManagerJson : 'SunbeamEditor/php/file_manager_json.php',
			allowFileManager : false,
			afterBlur: function(){this.sync();}
		});
		var editor = K.create('textarea[name="active_hezuomeiti"]', {
			cssPath : 'SunbeamEditor/plugins/code/prettify.css',
			uploadJson : 'SunbeamEditor/php/upload_json.php',
			fileManagerJson : 'SunbeamEditor/php/file_manager_json.php',
			allowFileManager : false,
			afterBlur: function(){this.sync();}
		});
		







		/////   点击上传图片
		var editor = K.editor({
			allowFileManager : false
		});
//		K('.upload-img').click(function() {
//			editor.loadPlugin('image', function() {
//				editor.plugin.imageDialog({
//					imageUrl : K('#active_pic').val(),
//					clickFn : function(url, title, width, height, border, align) {
//						K('#active_pic').val(url);
//						editor.hideDialog();
//					}
//				});
//			});
//		});
		
		
		
		K('.upload-img2').click(function() {
			editor.loadPlugin('image', function() {
				editor.plugin.imageDialog({
					imageUrl : K('#active_banner').val(),
					clickFn : function(url, title, width, height, border, align) {
						K('#active_banner').val(url);
						editor.hideDialog();
					}
				});
			});
		});
		
		K('#upload-images').click(function() {
			editor.loadPlugin('multiimage', function() {
				editor.plugin.multiImageDialog({
					clickFn : function(urlList) {
						K.each(urlList, function(i, data) {
						
			           var li ='<li><input type="text" class="editor-input w790" style="width:310px;margin-left:135px;" name="active_pic[]" value="'+data.url+'" id="active_pic"><a class="shanchu" style="color: red;margin-left: 5px;" href="javascript:;">X</a><input type="hidden" name="active_sollimg[]" class="active_sollimg" value="'+data.thumb+'" /></li>';
			            $("#photo-one").prepend(li);
						
						});
							$(".shanchu").on('click',function(){
								var div = $(this).parent("li");
								var URL = $(this).siblings('.editor-input').val();
									URL += ',';
									URL += $(this).siblings('.active_sollimg').val();
								$.ajax({
									type:"post",
									url:"ajax.php?tu=pian",
									data:{URL:URL},
									dataType:"json",
									success:function(data){
										if(data == 33){
											div.remove();
											alert("文件已经被删除")
										}
										if(data == 22){
											alert("文件删除失败")
										}else{
											div.remove();
										}
									}
								});
							})
						editor.hideDialog();
					}
				});
			});
		});
		
		
		
		
	});

</script>
<script type="text/javascript">
	$(".shanchu").click(function(){
								var div = $(this).parent("li");
								var URL = $(this).siblings('.editor-input').val();
									URL += ',';
									URL += $(this).siblings('.active_sollimg').val();
								$.ajax({
									type:"post",
									url:"ajax.php?tu=pian",
									data:{URL:URL},
									dataType:"json",
									success:function(data){
										if(data == 33){
											div.remove();
											alert("文件已经被删除")
										}
										if(data == 22){
											alert("文件删除失败")
										}else{
											div.remove();
										}
									}
								});
							})
</script>
</body>
</html>

